const themeSetting = require('../../config/antdv/theme');

module.exports = (options, context) => ({
  title: '协同云组件库',
  description: '基于antdv封装的UI组件库',
  // base: './',
  themeConfig: {
    nav: [
      { text: '首页', link: '/' },
      {
        text: '技术文档类',
        items: [
          {
            text: '微前端',
            link: '/pages/tech-docs/microFront',
          },
          {
            text: 'webpack',
            link: '/pages/tech-docs/webpack',
          },
          {
            text: '单元测试',
            link: '/pages/tech-docs/unitTest',
          },
          {
            text: '前端监控',
            link: '/pages/tech-docs/monitor',
          },
          {
            text: '可视化',
            items: [
              {
                text: 'D3.js',
                link: '/pages/tech-docs/visualization/D3',
              }
            ]
          },
          {
            text: '移动',
            items: [
              {
                text: 'RN',
                link: '/pages/tech-docs/mobile/flutter',
              },
              {
                text: 'flutter',
                link: '/pages/tech-docs/mobile/RN',
              }
            ]
          }
        ]
      },
      {
        text: '更多', items: [
          { text: '组件库说明', link: '/pages/guide/' },
          { text: '工具类', link: '/pages/tools/' }
        ]
      },
      { text: 'gitlab', link: 'http://gitlab.seeyon.com/cloud-platform-frontend/cloud-components' },
      { text: '单测覆盖率', link: 'https://cloud-components.seeyoncloud.com/unit-test-coverage/lcov-report/index.html' },
    ],
    sidebar: [
      {
        title: '组件库说明',
        path: '/pages/guide/',
      },
      {
        title: '相关组件说明',
        path: '/pages/components-doc/',
      },
      {
        title: '组件',
        collapsable: false,
        children: [
          {
            title: '操作类',
            collapsable: false,
            children: [
              {
                title: 'Button 按钮',
                path: '/pages/components/cloud-button/cloud-button',
                // key: ''
              },
              {
                title: 'Dropdown 下拉菜单',
                path: '/pages/components/cloud-dropdown/cloud-dropdown',
                // key: ''
              },
              {
                title: 'Search 搜索',
                path: '/pages/components/cloud-search/cloud-search',
                // key: ''
              },
              {
                title: 'Switch 开关',
                path: '/pages/components/cloud-switch/cloud-switch',
                // key: ''
              }
            ]
          },
          {
            title: '导航类',
            collapsable: false,
            children: [
              {
                title: 'Breadcrumb 面包屑',
                path: '/pages/components/cloud-breadcrumb/cloud-breadcrumb',
                key: ''
              },
              // {
              //   title: 'NavTabs 多层标签',
              //   path: '/pages/components/cloud-navTabs',
              //   key: ''
              // },
              {
                title: 'Pagination 翻页',
                path: '/pages/components/cloud-pagination/cloud-pagination',
                key: ''
              },
              {
                title: 'Steps 步骤条',
                path: '/pages/components/cloud-steps/cloud-steps',
                key: ''
              },
              {
                title: 'Tabs 标签页',
                path: '/pages/components/cloud-tabs/cloud-tabs',
                key: ''
              },
              {
                title: 'cloudNavTabs标签 (特殊)',
                path: '/pages/components/cloud-navTabs',
                key: ''
              },
              {
                title: 'Menu 菜单',
                path: '/pages/components/cloud-menu/cloud-menu',
                key: ''
              },
            ]
          },
          {
            title: '数据录入类',
            collapsable: false,
            children: [
              {
                title: 'Upload 上传',
                path: '/pages/components/cloud-upload/cloud-upload',
                key: ''
              },
              // {
              //   title: '上传1',
              //   path: '/pages/components/cloud-double-upload',
              //   key: ''
              // },
              {
                title: 'Input 输入框',
                path: '/pages/components/cloud-input/cloud-input',
                key: ''
              },
              {
                title: 'Textarea 文本域',
                path: '/pages/components/cloud-textarea/cloud-textarea',
                key: ''
              },
              {
                title: 'Input-number 数字输入框',
                path: '/pages/components/cloud-input-number/cloud-input-number',
                key: ''
              },
              {
                title: 'Date-picker 日期选择框',
                path: '/pages/components/cloud-date-picker/cloud-date-picker',
                key: ''
              },
              {
                title: 'Week-picker 周选择框',
                path: '/pages/components/cloud-week-picker/cloud-week-picker',
                key: ''
              },
              {
                title: 'Month-picker 月份选择框',
                path: '/pages/components/cloud-month-picker/cloud-month-picker',
                key: ''
              },
              {
                title: 'Range-picker 范围选择框',
                path: '/pages/components/cloud-range-picker/cloud-range-picker',
                key: ''
              },
              {
                title: 'Time-picker 时间选择框',
                path: '/pages/components/cloud-time-picker/cloud-time-picker',
                key: ''
              },
              {
                title: 'Radio 单选框',
                path: '/pages/components/cloud-radio/cloud-radio',
                key: ''
              },
              {
                title: 'Checkbox 复选框',
                path: '/pages/components/cloud-checkbox/cloud-checkbox',
                key: ''
              },
              {
                title: 'Select 选择框',
                path: '/pages/components/cloud-select/cloud-select',
                key: ''
              },
              {
                title: 'AutoComplete 自动完成',
                path: '/pages/components/cloud-auto-complete/cloud-auto-complete',
                key: ''
              },
              {
                title: 'Cascader 级联选择',
                path: '/pages/components/cloud-cascader/cloud-cascader',
                key: ''
              },
              {
                title: 'Rate 评分',
                path: '/pages/components/cloud-rate/cloud-rate',
                key: ''
              },
              {
                title: 'Slider 滑块',
                path: '/pages/components/cloud-slider/cloud-slider',
                key: ''
              },
            ]
          },
          {
            title: '展示类',
            collapsable: false,
            children: [
              // {
              //   title: 'Card 卡片',
              //   path: '/pages/components/cloud-business-card',
              //   key: ''
              // },
              {
                title: 'Collapse 折叠面板',
                path: '/pages/components/cloud-collapse/cloud-collapse',
                key: ''
              },
              {
                title: 'Form 表单',
                path: '/pages/components/cloud-form/cloud-form',
                key: ''
              },
              // {
              //   title: '表单元素',
              //   path: '/pages/components/cloud-form-item',
              //   key: ''
              // },
              {
                title: 'List 列表',
                path: '/pages/components/cloud-list/cloud-list',
                key: ''
              },
              {
                title: 'CheckList 选择列表',
                path: '/pages/components/cloud-check-list/cloud-check-list',
                key: ''
              },
              {
                title: 'Modal 模态框',
                path: '/pages/components/cloud-modal/cloud-modal',
                key: ''
              },
              {
                title: 'Table 表格',
                path: '/pages/components/cloud-table/cloud-table',
                key: ''
              },
              {
                title: 'Tree 树形',
                path: '/pages/components/cloud-tree/cloud-tree',
                key: ''
              },
              {
                title: 'TreeSelect 树型选择控件',
                path: '/pages/components/cloud-tree-select/cloud-tree-select',
                key: ''
              },
              {
                title: 'Transfer 穿梭框',
                path: '/pages/components/cloud-transfer/cloud-transfer',
                key: ''
              },
              {
                title: 'Transfer-list 列表穿梭框',
                path: '/pages/components/cloud-transfer-list/cloud-transfer-list',
                key: ''
              },
              {
                title: 'Empty 空状态',
                path: '/pages/components/cloud-empty/cloud-empty',
                key: ''
              },
              {
                title: 'Badge 徽标数',
                path: '/pages/components/cloud-badge/cloud-badge',
                key: ''
              },
              {
                title: 'Tag 标签',
                path: '/pages/components/cloud-tag/cloud-tag',
                key: ''
              },
              {
                title: 'Drawer 抽屉',
                path: '/pages/components/cloud-drawer/cloud-drawer',
                key: ''
              },
              {
                title: 'Carousel 走马灯',
                path: '/pages/components/cloud-carousel/cloud-carousel',
                key: ''
              },
              {
                title: 'Timeline 时间轴',
                path: '/pages/components/cloud-timeline/cloud-timeline',
                key: ''
              },
              {
                title: 'Avatar 头像',
                path: '/pages/components/cloud-avatar/cloud-avatar',
                key: ''
              },
              {
                title: 'Icon 图标',
                path: '/pages/components/cloud-icon/cloud-icon',
                key: ''
              },
              {
                title: 'Result 结果',
                path: '/pages/components/cloud-result/cloud-result',
                key: ''
              },
              {
                title: 'Img 图片占位',
                path: '/pages/components/cloud-img/cloud-img',
                key: ''
              }

            ]
          },
          {
            title: '提示类',
            collapsable: false,
            children: [
              {
                title: 'Confirm 确认框',
                path: '/pages/components/cloud-confirm/cloud-confirm',
                key: ''
              },
              {
                title: 'Dialog 弹出框',
                path: '/pages/components/cloud-dialog/cloud-dialog',
                key: ''
              },
              {
                title: 'Loading 加载',
                path: '/pages/components/cloud-loading/cloud-loading',
                key: ''
              },
              {
                title: 'Message 轻提示',
                path: '/pages/components/cloud-message/cloud-message',
                key: ''
              },
              {
                title: 'Tip 嵌入式提示',
                path: '/pages/components/cloud-tip/cloud-tip',
                key: ''
              },
              {
                title: 'Popover 气泡卡片',
                path: '/pages/components/cloud-popover/cloud-popover',
                key: ''
              },
              {
                title: 'Progress 进度条',
                path: '/pages/components/cloud-progress/cloud-progress',
                key: ''
              },
              {
                title: 'Tooltip 文字提示',
                path: '/pages/components/cloud-tooltip/cloud-tooltip',
                key: ''
              },
              {
                title: 'Popconfirm 气泡确认框',
                path: '/pages/components/cloud-popconfirm/cloud-popconfirm',
                key: ''
              }
            ]
          },
          {
            title: '布局类',
            collapsable: false,
            children: [
              {
                title: 'Grid 栅格',
                path: '/pages/components/cloud-grid/cloud-grid',
                key: ''
              },
              {
                title: 'Layout 布局',
                path: '/pages/components/cloud-layout/cloud-layout',
                key: ''
              },
            ]
          },
          {
            title: '其它',
            collapsable: false,
            children: [
              {
                title: 'Affix 固钉',
                path: '/pages/components/cloud-affix/cloud-affix',
                key: ''
              },
              {
                title: 'Skeleton 骨架屏',
                path: '/pages/components/cloud-skeleton/cloud-skeleton',
                key: ''
              },
              // {
              //   title: 'ConfigProvider 国际化',
              //   path: '/pages/components/cloud-config-provider',
              //   key: ''
              // }
            ]
          },
          {
            title: '套壳类',
            collapsable: false,
            children: [
              // {
              //   title: 'Grid 栅格Row(行)',
              //   path: '/pages/components/cloud-grid/cloud-grid',
              //   key: ''
              // },
              // {
              //   title: 'Grid 栅格Col(列)',
              //   path: '/pages/components/cloud-grid/cloud-grid',
              //   key: ''
              // },
              // {
              //   title: 'Affix 固钉',
              //   path: '/pages/components/cloud-affix',
              //   key: ''
              // },
              // {
              //   title: 'Badge 徽标数',
              //   path: '/pages/components/cloud-badge/cloud-badge',
              //   key: ''
              // },
              // {
              //   title: 'Carousel 走马灯',
              //   path: '/pages/components/cloud-carousel/cloud-carousel',
              //   key: ''
              // },
              // {
              //   title: 'Tag 标签',
              //   path: '/pages/components/cloud-tag',
              //   key: ''
              // },
              // {
              //   title: 'Timeline 时间轴',
              //   path: '/pages/components/cloud-timeline',
              //   key: ''
              // },
              // {
              //   title: 'AutoComplete 自动完成',
              //   path: '/pages/components/cloud-autoComplete',
              //   key: ''
              // },
              // {
              //   title: 'Cascader 级联选择',
              //   path: '/pages/components/cloud-cascader/cloud-cascader',
              //   key: ''
              // },
              // {
              //   title: 'Rate 评分',
              //   path: '/pages/components/cloud-rate/cloud-rate',
              //   key: ''
              // },
              // {
              //   title: 'Drawer 抽屉',
              //   path: '/pages/components/cloud-drawer',
              //   key: ''
              // },
              // {
              //   title: 'Popconfirm 气泡确认框',
              //   path: '/pages/components/cloud-popconfirm',
              //   key: ''
              // },
              // {
              //   title: 'Skeleton 骨架屏',
              //   path: '/pages/components/cloud-skeleton',
              //   key: ''
              // },
              // {
              //   title: 'Menu 菜单',
              //   path: '/pages/components/cloud-menu',
              //   key: ''
              // },
            ]
          }
        ]
      },
      {
        title: '工具类',
        path: '/pages/tools/',
      },
      {
        title: '技术文档类',
        collapsable: false,
        children: [
          {
            title: '微前端',
            path: '/pages/tech-docs/microFront',
          },
          {
            title: 'webpack',
            path: '/pages/tech-docs/webpack',
          },
          {
            title: '单元测试',
            path: '/pages/tech-docs/unitTest',
          },
          {
            title: '前端监控',
            path: '/pages/tech-docs/monitor',
          },
          {
            title: '可视化',
            collapsable: false,
            children: [
              {
                title: 'D3.js',
                path: '/pages/tech-docs/visualization/D3',
              }
            ]
          },
          {
            title: '移动',
            collapsable: false,
            children: [
              {
                title: 'RN',
                path: '/pages/tech-docs/mobile/flutter',
              },
              {
                title: 'flutter',
                path: '/pages/tech-docs/mobile/RN',
              }
            ]
          }
        ]
      },
    ],
    sidebarDepth: 0,
    lastUpdated: 'Last Updated', // string | boolean
  },
  less: {
    lessOptions: {
      modifyVars: themeSetting,
      javascriptEnabled: true,
      math: 'always'   // 此处指定为兼容 less-loader 3.x 的默认选项
    }
  },
  chainWebpack(config) {
    config.resolve.alias.set('cloud-components', process.cwd() + '/packages');
    config.resolve.alias.set('core-js/library/fn', 'core-js/features');
    config.module
      .rule('md')
      .test(/\.md$/)
      .use('vue-loader')
      .loader(require.resolve('./loader/replaceFile'))
      .options({
        replaceFiles: true, // 默认true, 是否将文件填充进md
        wrapper: false // 默认true,默认输出Vue Component ,false 时输出html片段
      })
      .end()
  }
});